import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘柄华
 * Date: 2022-06-17
 * Time: 12:07
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int n = sc.nextInt();
            int[] height = new int[n];

            for (int i = 0; i < n; i++) {
                height[i] = sc.nextInt();
            }
            int max = 1;
            int[] dp = new int[n];
            dp[0] = 1;
            for (int i = 1; i < n; i++) {
                dp[i] = 1;
                for (int j = 0; j < i; j++) {
                    if(height[i]>height[j]){
                        dp[i] = Math.max(dp[i],dp[j]+1);
                    }
                }
                max = Math.max(dp[i],max);
            }
            System.out.println(max);
        }
    }
}
